{% extends 'base.html' %}

{% block tips %}
    <h3>作者详情管理</h3>
{% endblock tips %}


{% block content %}
    <div class="col-md-offset-1 col-md-10">
        <p class="">
            <a href="{% url 'book:author_detail_add' %}">
                <button type="button" class="btn btn-primary">添加作者详情</button>
            </a>
        </p>
        <p>
        <p>
        <h3 class="text-center">作者详情列表</h3>
        </p>
        <table class="table table-bordered table-striped table-hover">
            <!-- On rows -->
            <thead>
            <tr>
                <td class="success">编号</td>
                <td class="info">姓名</td>
                <td class="info">生日</td>
                <td class="success">电话</td>
                <td class="info">地址</td>
                <td class="success">操作</td>
            </tr>
            </thead>
            <tbody>
            {% for authordetail in authordetails %}
                <tr>
                    <td>{{ forloop.counter }}</td>
                    <td>{{ authordetail.author.name }}</td>
                    <td>{{ authordetail.birthday|date:'Y-m-d' }}</td>
                    <td>{{ authordetail.telephone }}
                    </td>
                    <td>{{ authordetail.addr }}</td>
                    <td>
                        <button type="button" class="btn btn-warning"><a
                                href="{% url 'book:author_detail_edit' authordetail.id %}">编辑</a>
                        </button>
                        <button type="button" class="btn btn-danger"><a
                                href="{% url 'book:author_detail_del' authordetail.id %}">删除</a>
                        </button>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>

    </div>
{% endblock content %}

